package cn.edu.xaut.mybatisers.mall.Controller;

import cn.edu.xaut.mybatisers.mall.Service.ImageService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@Controller
public class ImageController {
    @Autowired
    ImageService imageService;

    @ApiOperation("请求图片")
    @RequestMapping(value = "/image", method = RequestMethod.GET)
    public void getImageByName(String imageName,HttpServletResponse response) throws IOException {
        imageService.getImageByName(imageName, response);
    }
}
